package ooday01;
/**调用构造方法创建对象*/
public class ConsTest {
    public static void main(String[] args) {
        //调用无参构造方法
        Car bm1=new Car();
        bm1.brand="宝马";
        bm1.color="白色";;
        bm1.price=100000;
        bm1.capacity=5;
        bm1.start();
        //调用有参构造方法
        Car bm2=new Car("宝马","黑色",200000,6);
        bm2.start();
        Car ad=new Car("奥迪","红色",300000,4);
        ad.run();

        Car bm =new Car();
        bm.brand="宝马";
        bm.color="黑色";
        bm.price=100000;
        bm.capacity=5;
        bm.start();
        bm.run();
        bm.stop();

        Car bc =new Car("奔驰","白色",200000,6);
        bc.start();
    }
}
